[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function            strtoddate - convert a date string to a structure

  Syntax              struct ddate *strtoddate(char *source);

  Prototype in        datehk.h

  Remarks             strtoddate converts a date abbreviation to a
                      structure of type ddate. The abbreviation can use
                      dashes or slashes (- or /) to separate the fields
                      of the date. All fields MUST be of length two (i.e.
                      02/07/87 is valid, but 2/7/87 and 02/07/1987 are
                      not valid.)

  Return value        returns a pointer to the storage location
                      containing the date structure, or NULL if space
                      could not be allocated.

  See also            Cal...(), date_convert(), ddatetofull(),
                      ddatetoshort(), ddatetostr(), fulltoddate(),
                      Greg...(), Jul...(), monthexpand(), shorttoddate()

  Example             #include <datehk.h>

                      main()
                      {
                           struct ddate *today;
                           char strtoday[9];

                           strcpy(strtoday,"04/01/67");
                           if ((today = strtoddate(strtoday) != NULL) {
                                printf("today is %d-%d-%d\n",
                                     today->dmon, today->dday,
                                     today->dyear);
                                printf("or %s\n", strtoday);
                           }
                      }

  Program output      today is 4-1-67
                      or 04/01/67


See Also: ddatetostr()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson